<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <div>
      {{ this.$store.getters.token }}
      {{ $store.state.user.token }}

      <div>
        <el-button v-if="show">详情</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  data() {
    return {
      isShow: false,
      list: [
        {
          name: 'whj1',
          age: 5,
          arr: ['10', '20'],
        },
        {
          name: 'whj2',
          age: 15,
          arr: ['5', '30'],
        },
      ],
    }
  },
  computed: {
    ...mapGetters(['name']),
    show() {
      this.list.map((item) => {
        if (item.arr.includes('10')) {
          this.isShow = true
        }
      })
      return this.isShow
    },
  },
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
